//
//  RecommendCellView.m
//  哔哩哔哩动画
//
//  Created by clip on 16/5/18.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "RecommendCellView.h"
//#import "UIImageView+WebCache.h"
#import "UIViewExt.h"

@implementation RecommendCellView

- (instancetype)initWithFrame:(CGRect)frame {
    
    
    if (self = [super initWithFrame:frame]) {
        
        
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height - 20)];
    
        imageView.layer.cornerRadius = 5;
        
//        [imageView sd_setImageWithURL:[NSURL URLWithString:self.imageString]];
        
        [self addSubview:imageView];
    
        UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, imageView.bottom + 2, frame.size.width, 10)];
        
        titleLabel.text = self.titlabelString;
        
        titleLabel.textAlignment = NSTextAlignmentLeft;
        
        [self addSubview:titleLabel];
        
        UIImageView *playImageView = [[UIImageView alloc] initWithFrame:CGRectMake(2, titleLabel.bottom + 3, 5, 5)];
    
        playImageView.image = [UIImage imageNamed:@"list_playnumb_icon@2x"];
        
        [self addSubview:playImageView];
        
        UILabel *playLabel = [[UILabel alloc] initWithFrame:CGRectMake(playImageView.right + 3, titleLabel.bottom + 3, (frame.size.width / 2) - 10, 5)];
        
        playLabel.text = self.playLabelString;
        
        playLabel.textAlignment = NSTextAlignmentLeft;
        
        [self addSubview:playLabel];
        
        UIImageView *danmakuImageView = [[UIImageView alloc] initWithFrame:CGRectMake(frame.size.width / 2, titleLabel.bottom + 3, 5, 5)];
        
        danmakuImageView.image = [UIImage imageNamed:@"list_danmaku_icon@2x"];
        
        [self addSubview:danmakuImageView];
        
        UILabel *danmakuLabel = [[UILabel alloc] initWithFrame:CGRectMake(danmakuImageView.right + 3, titleLabel.bottom + 3, (frame.size.width / 2) - 10, 5)];
        
        danmakuLabel.text = self.danmakuLabelString;
        
        danmakuLabel.textAlignment = NSTextAlignmentLeft;
        
        [self addSubview:danmakuLabel];
    
    }
    
    return self;
    
    
}

@end
